<?php
/*
Template Name: 2. ShopperPress Articles Page
*/
  
get_header(); 

?>

<h2 class="h2top"><?php echo SPEC($GLOBALS['_LANG']['_websitearticles']) ?></h2>

	<?php 
 	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
	$posts = query_posts('meta_key=type&meta_value=article&posts_per_page=10&paged='.$paged);		
	if (have_posts()) :  while (have_posts()) :  the_post(); 
	
	$Artimage = get_post_meta($post->ID, 'image', true);
	$hits = get_post_meta($post->ID, 'hits', true);

	?>						 				
 

<div class="ArticleBox">

	<?php if(strlen($Artimage) > 1){ ?><img src="<?php echo SPImage($Artimage,"m"); ?>" /><?php } ?>

	<h2><a href="<?php echo get_permalink($post->ID)?>" title="<?php echo $post->post_title; ?>"><?php echo $post->post_title; ?></a></h2>
	
	<div class="post-date"><em>On <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>,   <?php if($hits != ""){ echo SPEC($GLOBALS['_LANG']['_views'])." ".$hits." ,"; } ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> </em></div>
	<br />
	<div class="post-excerpt" style="line-height:30px;"><p><?php the_excerpt(); ?>  </p></div>
	<?php edit_post_link('<br />( Admin Edit )', '', ''); ?>
</div>

<div style="clear:both;"></div>


<?php endwhile; ?>

<?php endif; ?>

	<!-- PAGE NAVIGATION -->
	<div class="clear"></div>
	<br />
	<div class="navigation1" style="float:right;"><div class="navigation2">						
	<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else {  ?>						
	<div class="alignleft"><?php next_posts_link('',0) ?></div>
	<div class="alignright"><?php previous_posts_link('',0) ?></div>							
	<?php  } ?>						
	</div><br /><div style="clear:both;"></div></div>
	<!-- PAGE NAVIGATION -->

<?php get_footer(); ?>